package ${classPath};

import java.util.Set;
import java.util.Date;
import javax.validation.constraints.Digits;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.Size;
import org.hibernate.validator.constraints.Length;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import top.lemna.base.core.dto.range.TimeRange;
import top.lemna.base.utils.BeanUtils;

@Data
@ToString
@ApiModel(value = "${classComment}查询")
public class  ${domain}QueryCommand {

<#list fieldList as field>
<#compress>
<#list field.annotations as annotation> 
<#if annotation?starts_with("@Column")>
<#if field.type="String"> 
</#if>
<#if field.type="Long">
  @Min(0)
  @Max(Integer.MAX_VALUE)
</#if>
<#if field.type="Integer">
  @Min(0)
  @Max(Integer.MAX_VALUE)
</#if>
<#if field.type="Double">
  @Digits(integer=6, fraction=2)
</#if>
</#if>
</#list>
</#compress>

  private ${field.type} ${field.name};

<#if field.name?ends_with("ype") || field.name?ends_with("tatus")>
  @Size(max = 5)
  private Set<${field.type}> exclude${field.name?cap_first};
 
  @Size(max = 5)
  private Set<${field.type}> include${field.name?cap_first};
</#if>
</#list>

  
  /** 创建时间 */
  private TimeRange createTime; 
 
  public ${domain}QueryDto convertToDto() {
    ${domain}QueryDto dto = new ${domain}QueryDto();
    BeanUtils.copyPropertiesIgnoreNull(this, dto);
    return dto;
  }
}